package com.gperp.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gperp.common.GPResult;
import com.gperp.pojo.AsRolePremission;
import com.gperp.service.PremissionService;

@Controller
public class PremissionController {
	@Resource
	private PremissionService premissionService;
	
	@RequestMapping(value="premissionList",method=RequestMethod.GET)
	@CrossOrigin
	@ResponseBody
	public List<AsRolePremission> premissionList(Long id){
		return premissionService.queryList(id);
	}
	
	@RequestMapping(value="updatePremission",method=RequestMethod.GET)
	@CrossOrigin
	@ResponseBody
	public GPResult updatePremission(Long roleid,String add,String del){
		return premissionService.updatePremission(roleid,add,del);
	}
}
